package com.heima.search.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        /**
         * 表示把我们自己定义的拦截器，注册到springmvc拦截器中心中去，意思让springmvc承认
         */
        registry.addInterceptor(new ApTokenInterceptor()).addPathPatterns("/**")
                .excludePathPatterns("/login/login_auth");
    }
}
